<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>javascript build website</title>
<script src="http://www.m3958.com/yui/3.5.0pr2/build/yui/yui-min.js"></script>

</head>
<body>
<ul id="articleUl">
</ul>
<a id="adduploader" href="#">上传文件</a>
<div id="fileUploader"></div>

<script type="text/javascript">
var m3958_hostname = "http://www.m3958.com/";
(function(){
	var hr = window.location.href;
	if(hr.indexOf('8888') == -1){
		if(hr.indexOf('debug=true') != -1){
			m3958_hostname = 'file:///E:/eclipse-jee-helios-SR1-win32/xyzcms/war/';
		}
	}else{
		m3958_hostname = 'http://127.0.0.1:8888/';
	}
})();

YUI({combine: true,
	comboBase: m3958_hostname + 'combo/yui?',
	modules:{
		'progress-bar-css' : {
	        type: "css",
	        fullpath: m3958_hostname + 'm3958-module-css/progressbar.css'
		},
		'progress-bar' : {
			requires:['widget','progress-bar-css'],
			fullpath : m3958_hostname + 'm3958-module-js/progressbar.js'
		},
		'ajax-uploader' : {
			requires:['widget','io-upload-iframe','json','event','progress-bar','progress-bar-css'],
			fullpath : m3958_hostname + 'm3958-module-js/ajaxuploader.js'
		}
}}).use('ajax-uploader',function(Y){
	var ub = Y.one('#adduploader');
	var firstFired = false;
	ub.on('click',function(e){
		e.preventDefault();
		if(!firstFired){
			ub.setContent('再传一个');
		}
		var fu = new Y.M3958.AjaxUploader({tmp:true});
		fu.render('#fileUploader');
		fistFired = true;
	});
});

</script>
</body>
</html>